package com.dyx.lifecycle;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author dengyouxu
 * @description TODO
 * @since 2021-05-10 下午4:36
 */
public class LogLifeCycleListener implements LifeCycleListener {

    private static final Logger LOGGER = LoggerFactory.getLogger(LogLifeCycleListener.class);

    public void doSomeThingOnEvent(LifeCycleEvent lifeCycleEvent) {
        if (lifeCycleEvent.equals(LifeCycleEvent.START)) {
            LOGGER.info("启动了...");
            return;
        }
        if (lifeCycleEvent.equals(LifeCycleEvent.STOP)) {
            LOGGER.info("即将停止...");
        }
    }
}
